package top.ddltech.stubborn;

import top.ddltech.stubborn.graphics3D.SimpleTexturedPolygonRenderer;
import top.ddltech.stubborn.math3D.Polygon3D;
import top.ddltech.stubborn.math3D.Transform3D;
import top.ddltech.stubborn.math3D.Vector3D;
import top.ddltech.stubborn.math3D.ViewWindow;
import top.ddltech.stubborn.test.GameCore3D;

public class TextureMapTest1 extends GameCore3D {

    public static void main(String[] args) {
        new TextureMapTest1().run();
    }

    @Override
    public void createPolygons() {
        Polygon3D poly;

        // one wall for now
        poly = new Polygon3D(
                new Vector3D(-128, 256, -1000),
                new Vector3D(-128, 0, -1000),
                new Vector3D(128, 0, -1000),
                new Vector3D(128, 256, -1000)
        );
        polygons.add(poly);
    }

    @Override
    public void createPolygonRenderer() {
        viewWindow = new ViewWindow(0, 0,
                screen.getWidth(), screen.getHeight(),
                (float) Math.toRadians(75));

        Transform3D camera = new Transform3D(0, 100, 0);
        polygonRenderer = new SimpleTexturedPolygonRenderer(
                camera, viewWindow, "assets/images/test_pattern.png"
        );
    }
}
